import 'dart:convert';

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_picker/picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:taonile/entity/refund_order_detail_entity.dart';
import 'package:taonile/utils/event_msg.dart';

import '../config/config.dart';
import '../http/api.dart';
import '../utils/singleton_manager.dart';

///
/// 退款单详情
///
class RefundOrderDetail extends StatefulWidget {
  var orderNo = '';
  var isShowExpress = '0';

  RefundOrderDetail({Key? key, this.orderNo = '', this.isShowExpress = '0'}) : super(key: key);

  @override
  State<RefundOrderDetail> createState() => _RefundOrderDetailState();
}

class _RefundOrderDetailState extends State<RefundOrderDetail> {
  RefundOrderDetailEntity entity = RefundOrderDetailEntity();
  List<String> images = [];

  String stepTitle = '';
  String infoTitle = '';
  String reasonTitle = '';

  String expressTitle = '请选择';
  String expressNo = '';

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    orderDetail();
    getExpressNameList();
  }

  //快递公司列表，缓存到本地
  getExpressNameList() async {
    if (SingletonManager.instance.expressNameList.isNotEmpty) {
      return;
    }
    dynamic result = await Api.expressNameList();
    var jsonResult = jsonDecode(jsonEncode(result));
    List<dynamic> amountObj = jsonResult['data'];
    List<String> reason = [];
    for (var item in amountObj) {
      reason.add(item.toString());
    }
    SingletonManager.instance.expressNameList = reason;
  }

  postExpress() async {
    if (expressTitle == '请选择') {
      EasyLoading.showToast('请选择快递公司');
      return;
    }
    if (expressNo.isEmpty || expressNo.length < 8) {
      EasyLoading.showToast('请输入正确的快递单号');
      return;
    }

    dynamic result = await Api.addExpress({
      'id': widget.orderNo,
      'express_name': expressTitle,
      'express_no': expressNo,
    });
    var jsonResult = jsonDecode(jsonEncode(result));
    if (jsonResult['code'] == 1) {
      EasyLoading.showToast("提交成功");
      setState(() {
        widget.isShowExpress = '0';
      });
      //发消息让退款列表刷新
      SingletonManager.instance.eventBus.fire(RefundListUp());
    }
  }

  orderDetail() async {
    dynamic result = await Api.refundOrderDetail({'id': widget.orderNo});
    setState(() {
      entity = RefundOrderDetailEntity.fromJson(result);
      entity.data.orderDrawbackPlan = entity.data.orderDrawbackPlan.reversed.toList();

      String str = entity.data.image;
      if (str.isNotEmpty) {
        if (str.endsWith(',')) {
          str = str.substring(0, str.length - 1);
        }
        images = str.split(',');
      }

      if (entity.data.type == 1 || entity.data.type == 2) {
        stepTitle = '退款进度';
        infoTitle = '退款信息';
        reasonTitle = '退款原因';
      } else {
        stepTitle = '订单进度';
        infoTitle = '订单信息';
        reasonTitle = '申请原因';
      }
    });
  }

  getSkuStr(List<RefundOrderDetailDataSkuData> currentSku) {
    StringBuffer sb = StringBuffer();
    for (int i = 0; i < currentSku.length; i++) {
      sb.write(currentSku[i].skuVal);
      if (i != currentSku.length - 1) {
        sb.write('/');
      }
    }
    return sb.toString();
  }

  refundOrder(BuildContext context) async {
    Picker(
        adapter: PickerDataAdapter(
            pickerData: SingletonManager.instance.expressNameList, isArray: false),
        height: 350.w,
        headerDecoration: BoxDecoration(
          color: Config.colorWhite,
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(20.w),
            topRight: Radius.circular(20.w),
          ),
        ),
        itemExtent: 70.w,
        confirmText: '确定',
        cancelText: '取消',
        columnPadding: EdgeInsets.all(15.w),
        onConfirm: (picker, list) {
          // LogUtil.v(SingletonManager.instance.refundReason[list[0]]);
          setState(() {
            expressTitle = SingletonManager.instance.expressNameList[list[0]];
          });
        }).showModal(context, backgroundColor: Colors.transparent);
  }

  Widget getListItem(int index) {
    return Container(
      height: 125.w,
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            width: 70.w,
            alignment: Alignment.center,
            child: Column(
              children: [
                Visibility(
                  visible: index == 0,
                  child: Container(
                    width: 20.w,
                    height: 20.w,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.all(Radius.circular(10.w)),
                      color: Config.colorMain,
                    ),
                  ),
                ),
                Visibility(
                  visible: index != 0,
                  child: Container(
                    width: 13.w,
                    height: 13.w,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.all(Radius.circular(10.w)),
                      color: Config.colorText3,
                    ),
                  ),
                ),
                Container(
                  margin: EdgeInsets.symmetric(vertical: 5.w),
                  width: 1.5.w,
                  height: index == 0 ? 95.w : 102.w,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.all(Radius.circular(0.w)),
                    color: Config.colorText3,
                  ),
                ),
              ],
            ),
          ),
          Container(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  entity.data.orderDrawbackPlan[index].title,
                  style: TextStyle(fontSize: 25.sp, height: 1.0, color: Config.colorText1),
                ),
                Text(
                  entity.data.orderDrawbackPlan[index].detail.isNotEmpty
                      ? entity.data.orderDrawbackPlan[index].detail
                      : '...',
                  style: TextStyle(fontSize: 22.sp, height: 1.8, color: Config.colorText3),
                ),
                Text(
                  entity.data.orderDrawbackPlan[index].createdAt,
                  style: TextStyle(fontSize: 22.sp, height: 1.6, color: Config.colorText3),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }

  Widget getListItem2(int index) {
    return Container(
      width: 120.w,
      height: 120.w,
      margin: EdgeInsets.only(right: 20.w),
      decoration: BoxDecoration(
        color: Config.colorBg2,
        borderRadius: BorderRadius.circular(10.w),
      ),
      child: Stack(
        children: [
          ClipRRect(
            borderRadius: BorderRadius.all(Radius.circular(8.w)),
            child: CachedNetworkImage(
              imageUrl: images[index],
              fit: BoxFit.fill,
              width: double.infinity,
              height: double.infinity,
              errorWidget: (context, url, error) {
                return Image.asset(
                  'assets/images/bg_default_400.png',
                  width: double.infinity,
                  height: double.infinity,
                  fit: BoxFit.fill,
                );
              },
            ),
          ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('售后详情'),
        centerTitle: true,
      ),
      body: Container(
        width: double.infinity,
        color: Config.colorBg2,
        height: double.infinity,
        child: Stack(
          children: [
            SingleChildScrollView(
              scrollDirection: Axis.vertical,
              child: Column(
                children: [
                  //状态区
                  Container(
                    margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w),
                    height: 100.w,
                    padding: EdgeInsets.symmetric(horizontal: 25.w),
                    decoration: BoxDecoration(
                      color: Config.colorWhite,
                      borderRadius: BorderRadius.circular(10.w),
                    ),
                    child: Row(
                      children: [
                        Column(
                          mainAxisAlignment: MainAxisAlignment.center,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(
                              entity.code == 1 ? entity.data.title : '',
                              style: TextStyle(fontSize: 26.sp, height: 1.2, color: Colors.red),
                            ),
                            Visibility(
                              visible: entity.code == 1 &&
                                  (entity.data.type == 1 || entity.data.type == 2),
                              child: Text(
                                '退款金额：${entity.code == 1 ? entity.data.totalPrice : '0'}金券',
                                style: TextStyle(
                                    fontSize: 20.sp, height: 1.8, color: Config.colorText1),
                              ),
                            ),
                          ],
                        ),
                      ],
                    ),
                  ),
                  //进度区
                  Container(
                    margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w),
                    decoration: BoxDecoration(
                      color: Config.colorWhite,
                      borderRadius: BorderRadius.circular(10.w),
                    ),
                    width: double.infinity,
                    padding: EdgeInsets.only(left: 0.w, right: 0.w, top: 0.w),
                    child: Column(
                      children: [
                        Container(
                          width: double.infinity,
                          padding: EdgeInsets.all(25.w),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                stepTitle,
                                style: TextStyle(fontSize: 28.sp),
                              ),
                            ],
                          ),
                        ),
                        Divider(
                          color: Config.colorDivider,
                          height: 2.w,
                          thickness: 2.w,
                        ),
                        Container(
                          width: double.infinity,
                          margin: EdgeInsets.symmetric(vertical: 25.w),
                          padding: EdgeInsets.symmetric(horizontal: 30.w),
                          height: entity.code == 1
                              ? (entity.data.orderDrawbackPlan.length * 125.w)
                              : 125.w,
                          child: ListView.builder(
                            physics: const NeverScrollableScrollPhysics(),
                            itemCount: entity.code == 1 ? entity.data.orderDrawbackPlan.length : 0,
                            scrollDirection: Axis.vertical,
                            itemBuilder: (BuildContext context, int index) {
                              return getListItem(index);
                            },
                          ),
                        ),
                      ],
                    ),
                  ),
                  //填写快递单号区
                  Visibility(
                    visible:
                        entity.code == 1 && entity.data.type == 2 && widget.isShowExpress == '1',
                    child: Container(
                      margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w),
                      decoration: BoxDecoration(
                        color: Config.colorWhite,
                        borderRadius: BorderRadius.circular(10.w),
                      ),
                      width: double.infinity,
                      padding: EdgeInsets.only(left: 0.w, right: 0.w, top: 0.w),
                      child: Column(
                        children: [
                          Container(
                            width: double.infinity,
                            padding: EdgeInsets.all(25.w),
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  '请退回商品，上传运单号',
                                  style: TextStyle(fontSize: 28.sp),
                                ),
                              ],
                            ),
                          ),
                          Divider(
                            color: Config.colorDivider,
                            height: 2.w,
                            thickness: 2.w,
                          ),
                          Container(
                            padding: EdgeInsets.all(25.w),
                            child: InkWell(
                              onTap: () => refundOrder(context),
                              child: Row(
                                mainAxisAlignment: MainAxisAlignment.start,
                                children: [
                                  Column(
                                    crossAxisAlignment: CrossAxisAlignment.start,
                                    mainAxisAlignment: MainAxisAlignment.center,
                                    children: [
                                      Text(
                                        '快递公司',
                                        style: TextStyle(fontSize: 25.sp),
                                      ),
                                    ],
                                  ),
                                  Padding(
                                    padding: EdgeInsets.only(left: 60.w),
                                  ),
                                  Row(
                                    crossAxisAlignment: CrossAxisAlignment.center,
                                    children: [
                                      Text(
                                        expressTitle,
                                        style: TextStyle(fontSize: 24.sp, color: Config.colorText1),
                                      ),
                                      Icon(
                                        Icons.arrow_forward_ios,
                                        size: 22.w,
                                        color: Config.colorText1,
                                      )
                                    ],
                                  ),
                                ],
                              ),
                            ),
                          ),
                          Divider(
                            color: Config.colorDivider,
                            height: 2.w,
                            thickness: 2.w,
                          ),
                          Container(
                            padding: EdgeInsets.all(25.w),
                            child: InkWell(
                              onTap: () => refundOrder(context),
                              child: Row(
                                mainAxisAlignment: MainAxisAlignment.start,
                                children: [
                                  Column(
                                    crossAxisAlignment: CrossAxisAlignment.start,
                                    mainAxisAlignment: MainAxisAlignment.center,
                                    children: [
                                      Text(
                                        '快递单号',
                                        style: TextStyle(fontSize: 25.sp),
                                      ),
                                    ],
                                  ),
                                  Container(
                                    margin: EdgeInsets.only(left: 60.w),
                                    width: 500.w,
                                    child: TextField(
                                      keyboardType: TextInputType.text,
                                      textAlign: TextAlign.justify,
                                      obscureText: false,
                                      maxLength: 50,
                                      autofocus: false,
                                      maxLines: 1,
                                      onChanged: (value) {
                                        setState(() {
                                          expressNo = value;
                                        });
                                      },
                                      style: TextStyle(fontSize: 24.sp, color: Config.colorText1),
                                      decoration: const InputDecoration(
                                        hintStyle: TextStyle(color: Config.colorText3),
                                        hintText: "请输入快递单号",
                                        counterText: '',
                                        isDense: true,
                                        border: InputBorder.none,
                                        contentPadding: EdgeInsets.zero, //设置文本内容的Padding
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                          Divider(
                            color: Config.colorDivider,
                            height: 2.w,
                            thickness: 2.w,
                          ),
                          Container(
                            height: 88.w,
                            padding: EdgeInsets.symmetric(vertical: 15.w, horizontal: 0.w),
                            margin: EdgeInsets.only(top: 0.w),
                            child: ElevatedButton(
                              clipBehavior: Clip.antiAlias,
                              onPressed: () {
                                postExpress();
                              },
                              style: ElevatedButton.styleFrom(shape: const StadiumBorder()),
                              child: Text(
                                '提交快递单号',
                                style: TextStyle(fontSize: 22.sp),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  //退货地址
                  Visibility(
                    visible: entity.code == 1 && entity.data.type == 2,
                    child: Container(
                      padding: EdgeInsets.symmetric(horizontal: 25.w),
                      margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w),
                      decoration: BoxDecoration(
                        color: Config.colorWhite,
                        borderRadius: BorderRadius.circular(10.w),
                      ),
                      height: 120.w,
                      child: InkWell(
                        onTap: () {},
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              mainAxisAlignment: MainAxisAlignment.center,
                              children: [
                                Text(
                                  '退货地址',
                                  style: TextStyle(fontSize: 25.sp),
                                ),
                              ],
                            ),
                            Row(
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                Container(
                                  padding: EdgeInsets.only(left: 50.w),
                                  width: 500.w,
                                  height: 120.w,
                                  child: Column(
                                    mainAxisAlignment: MainAxisAlignment.center,
                                    crossAxisAlignment: CrossAxisAlignment.end,
                                    children: [
                                      Text(
                                        '${entity.code == 1 ? entity.data.name : ''}  ${entity.code == 1 ? entity.data.phone : ''}',
                                        style: TextStyle(fontSize: 24.sp, color: Config.colorText1),
                                      ),
                                      Text(
                                        entity.code == 1 ? entity.data.address : '',
                                        textAlign: TextAlign.right,
                                        style: TextStyle(
                                            fontSize: 22.sp, height: 1.6, color: Config.colorText2),
                                      ),
                                    ],
                                  ),
                                ),
                                Padding(
                                  padding: EdgeInsets.only(right: 10.w),
                                ),
                              ],
                            ),
                          ],
                        ),
                      ),
                    ),
                  ),
                  //信息区
                  Container(
                    margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w),
                    decoration: BoxDecoration(
                      color: Config.colorWhite,
                      borderRadius: BorderRadius.circular(10.w),
                    ),
                    child: Column(
                      children: [
                        Container(
                          width: double.infinity,
                          padding: EdgeInsets.all(25.w),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                infoTitle,
                                style: TextStyle(fontSize: 28.sp),
                              ),
                            ],
                          ),
                        ),
                        Divider(
                          color: Config.colorDivider,
                          height: 2.w,
                          thickness: 2.w,
                        ),
                        Container(
                          padding: EdgeInsets.all(25.w),
                          height: 148.w,
                          decoration: BoxDecoration(
                            border:
                                Border(bottom: BorderSide(color: Config.colorDivider, width: 1.w)),
                          ),
                          child: Row(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Container(
                                margin: EdgeInsets.only(right: 25.w),
                                child: ClipRRect(
                                  borderRadius: BorderRadius.circular(5),
                                  child: CachedNetworkImage(
                                    imageUrl: entity.code == 1 ? entity.data.goodsImage : '',
                                    fit: BoxFit.fill,
                                    width: 100.w,
                                    height: 100.w,
                                    errorWidget: (context, url, error) {
                                      return Image.asset(
                                        'assets/images/bg_default_400.png',
                                        width: 100.w,
                                        height: 100.w,
                                        fit: BoxFit.fill,
                                      );
                                    },
                                  ),
                                ),
                              ),
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Container(
                                    width: 530.w,
                                    child: Text(
                                      entity.code == 1 ? entity.data.goodsName : '',
                                      softWrap: false,
                                      style: TextStyle(color: (Config.colorText1), fontSize: 22.w),
                                    ),
                                  ),
                                  Container(
                                    width: 530.w,
                                    child: Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: [
                                        Text(
                                          getSkuStr(entity.data.skuData),
                                          softWrap: true,
                                          style:
                                              TextStyle(color: (Config.colorText1), fontSize: 20.w),
                                        ),
                                        Text(
                                          "X${entity.code == 1 ? entity.data.num : '1'}",
                                          softWrap: true,
                                          style:
                                              TextStyle(color: (Config.colorText1), fontSize: 20.w),
                                        ),
                                      ],
                                    ),
                                  ),
                                  Container(
                                    margin: EdgeInsets.only(top: 5.w),
                                    width: 530.w,
                                    child: Text(
                                      entity.code == 1 ? entity.data.totalPrice : '0',
                                      softWrap: true,
                                      style: TextStyle(color: (Config.colorText1), fontSize: 20.w),
                                    ),
                                  ),
                                ],
                              ),
                            ],
                          ),
                        ),
                        Divider(
                          color: Config.colorDivider,
                          height: 2.w,
                          thickness: 2.w,
                        ),
                        Container(
                          width: double.infinity,
                          padding: EdgeInsets.all(25.w),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                reasonTitle,
                                style: TextStyle(fontSize: 24.sp),
                              ),
                              Text(
                                entity.code == 1 ? entity.data.refundReason : '',
                                style: TextStyle(fontSize: 24.sp),
                              ),
                            ],
                          ),
                        ),
                        Visibility(
                          visible:
                              entity.code == 1 && (entity.data.type == 1 || entity.data.type == 2),
                          child: Divider(
                            color: Config.colorDivider,
                            height: 2.w,
                            thickness: 2.w,
                          ),
                        ),
                        Visibility(
                          visible:
                              entity.code == 1 && (entity.data.type == 1 || entity.data.type == 2),
                          child: Container(
                            width: double.infinity,
                            padding: EdgeInsets.all(25.w),
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  "退款金额",
                                  style: TextStyle(fontSize: 24.sp),
                                ),
                                Text(
                                  entity.code == 1 ? '${entity.data.totalPrice}金券' : '0',
                                  style: TextStyle(fontSize: 24.sp),
                                ),
                              ],
                            ),
                          ),
                        ),
                        Visibility(
                          visible:
                              entity.code == 1 && (entity.data.type == 1 || entity.data.type == 2),
                          child: Divider(
                            color: Config.colorDivider,
                            height: 2.w,
                            thickness: 2.w,
                          ),
                        ),
                        Visibility(
                          visible:
                              entity.code == 1 && (entity.data.type == 1 || entity.data.type == 2),
                          child: Container(
                            width: double.infinity,
                            padding: EdgeInsets.all(25.w),
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  "申请件数",
                                  style: TextStyle(fontSize: 24.sp),
                                ),
                                Text(
                                  entity.code == 1 ? entity.data.num.toString() : '1',
                                  style: TextStyle(fontSize: 24.sp),
                                ),
                              ],
                            ),
                          ),
                        ),
                        Divider(
                          color: Config.colorDivider,
                          height: 2.w,
                          thickness: 2.w,
                        ),
                        Container(
                          width: double.infinity,
                          padding: EdgeInsets.all(25.w),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                "申请时间",
                                style: TextStyle(fontSize: 24.sp),
                              ),
                              Text(
                                entity.code == 1 ? entity.data.createdAt : '',
                                style: TextStyle(fontSize: 24.sp),
                              ),
                            ],
                          ),
                        ),
                        Divider(
                          color: Config.colorDivider,
                          height: 2.w,
                          thickness: 2.w,
                        ),
                        Container(
                          width: double.infinity,
                          padding: EdgeInsets.all(25.w),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                "订单编号",
                                style: TextStyle(fontSize: 24.sp),
                              ),
                              Text(
                                entity.code == 1 ? entity.data.orderNo : '',
                                style: TextStyle(fontSize: 24.sp),
                              ),
                            ],
                          ),
                        ),
                        Divider(
                          color: Config.colorDivider,
                          height: 2.w,
                          thickness: 2.w,
                        ),
                        Visibility(
                          visible: entity.code == 1 && entity.data.describe.isNotEmpty,
                          child: Container(
                            width: double.infinity,
                            padding: EdgeInsets.all(25.w),
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  "补充描述",
                                  style: TextStyle(fontSize: 24.sp),
                                ),
                                Text(
                                  entity.code == 1 ? entity.data.describe : '',
                                  style: TextStyle(fontSize: 24.sp),
                                ),
                              ],
                            ),
                          ),
                        ),
                        Visibility(
                          visible: entity.code == 1 && entity.data.image.isNotEmpty,
                          child: Divider(
                            color: Config.colorDivider,
                            height: 2.w,
                            thickness: 2.w,
                          ),
                        ),
                        Visibility(
                          visible: entity.code == 1 && entity.data.image.isNotEmpty,
                          child: Container(
                            width: double.infinity,
                            padding: EdgeInsets.all(25.w),
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Text(
                                  "凭证图片",
                                  style: TextStyle(fontSize: 24.sp),
                                ),
                                Container(
                                  margin: EdgeInsets.only(top: 20.w),
                                  height: 120.w,
                                  child: ListView.builder(
                                    physics: const NeverScrollableScrollPhysics(),
                                    itemCount: images.length,
                                    scrollDirection: Axis.horizontal,
                                    itemBuilder: (BuildContext context, int index) {
                                      return getListItem2(index);
                                    },
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                  SizedBox(
                    height: 120.w,
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
